<template>
    <div class="demo-input-suffix">
        <el-row type="flex" class="row-bg" style="margin-top:1em;">
            <el-col :span="3">
                <div>内容类型：</div>
            </el-col>
            <el-col :span="3">
                <el-select v-model="exam.type" @change="change" :disabled="exam.disable">
                    <el-option v-for="item in exam.types" :key="item.code" :label="item.name"
                               :value="item.code"></el-option>
                </el-select>
            </el-col>
        </el-row>
        <el-row type="flex" class="row-bg" style="margin-top:1em;">
            <el-col :span="3">
                <div>{{typeName}}标题：</div>
            </el-col>
            <el-col :span="20">
                <div>
                    <el-input v-model.trim="articleInfo.title" placeholder="请输入标题" clearable></el-input>
                </div>
            </el-col>
        </el-row>
        <el-row type="flex" class="row-bg" style="margin-top:1em;"
                v-if="typeName == '题目' || typeName == '解决方案' || typeName == '经验交流'">
            <el-col :span="3">
                <div>所属语言：</div>
            </el-col>
            <el-col :span="3">
                <el-select v-model="developLan.type" @change="change">
                    <el-option v-for="item in developLan.list" :key="item.id" :label="item.enName"
                               :value="item.id"></el-option>
                </el-select>
            </el-col>
        </el-row>
        <el-row type="flex" class="row-bg" style="margin-top:1em;"
                v-if="typeName == '题目' || typeName == '解决方案' || typeName == '经验交流'">
            <el-col :span="3">
                <div>{{typeName}}明细：</div>
            </el-col>
            <el-col :span="20">
                <div id="subject">
                    <mavon-editor @imgAdd="$imgAdd" style="height: 100%;width: 100%;z-index:1;" v-model="articleInfo.subject"
                                  :toolbars="toolbars" @save="saveMavon" @change="changeSubject"></mavon-editor>
                </div>
            </el-col>
        </el-row>
        <el-row type="flex" class="row-bg" style="margin-top:2em;">
            <el-col :span="3">
                <div>{{typeName}}内容：</div>
            </el-col>
            <el-col :span="20">
                <div id="editor">
                    <mavon-editor @imgAdd="$imgAdd" style="height: 100%;width: 100%;z-index:1;" v-model="articleInfo.content"
                                  :toolbars="toolbars" @save="saveMavon" @change="changeData"></mavon-editor>
                </div>
            </el-col>
        </el-row>
        <el-row style="margin-top:3em;">
            <el-col :span="3">
                <div>
                    <el-button type="success" @click="save">保存</el-button>
                </div>
            </el-col>
            <el-col :span="6">
                <div>
                    <el-button type="success" @click="saveAndClear">保存并清空</el-button>
                </div>
            </el-col>
            <el-col :span="6">
                <div>
                    <el-button type="warning" @click="commit">保存并提交审核</el-button>
                </div>
            </el-col>
        </el-row>
    </div>
</template>

<script>
  import {data} from '@/contentjs/resourceEdit.js'

  export default data
</script>

<style scoped>
</style>
